OPC Studio User's Guide and Reference
OPC UA PubSub physical identifiers
Common Fundamentals > Identifying information in OPC UA PubSub > OPC UA PubSub physical identifiers
In This Topic

This article describes the physical identifiers used in OPC UA PubSub communication. For a distinction between physical and logical identifiers, see Identifying information in OPC UA PubSub.

Network Address and Resource Address

Network address is an abstract concept used to represent the basic information needed to make a PubSub connection to the message oriented middleware. In OPC Studio products, it represented by the NetworkAddress Class. The network address specifies a network interface used for the communication, with its InterfaceName Property. This is an empty string if you want to leave the choice of the network interface up to the component, or a non-empty string specifying the name of the network interface on the computer where the component runs.

Resource address is a concrete derivation of network address, in which the network address information is represented by a resource string - essentially, a URL string. Currently, all network addresses used in OPC UA PubSub are resource addresses. In OPC Studio, resource address is represented by the ResourceAddress Class. The actual URL information is stored in its ResourceDescriptor Property.

URL schemes and syntaxes

The URL schemes and syntaxes for OPC UA PubSub are described in OPC specifications. For datagram-oriented transports, the ones currently supported by core OPC Studio are:

With UDP, both IPv4 and IPv6 addresses are supported.

OPC Studio components support Enhanced Host Name Resolution in OPC UA PubSub URLs. This allows you to conveniently and reliably use some pre-defined host names as shortcuts for IP and MAC addresses with the above URL schemes, such as "ip6-allrouters" or "eth-broadcast".

OPC Data Client will, by default, use MQTT protocol with any of the URL schemes below:

The details of the URL syntax are then left on the concrete MQTT communication package used (see MQTT communication packages). Some communication packages define useful extensions to the URL syntax, which are described with each communication package. The basic syntax options, described in the OPC UA PubSub specification, are supported by every communication package (as long as the corresponding scheme is supported at all), i.e.:

Publisher Id

The publisher Id is a unique identifier for a publisher with the message-oriented middleware. A publisher can use a publisher Id of one of these types:

Publisher Ids are only equal if both their type and their value are equal. For example, a UInt16 publisher Id with value 31 is different from UInt32 publisher Id with the same value. You therefore need to be careful when specifying the publisher Ids, and with numerical Ids, pay attention to their precise type. Also, a String publisher Id is different from any numerical publisher Id, even if it carries a string representation of the same numerical value (such as a string "31", in our example).

In OPC Studio, the publisher Id is represented by the UAPublisherId Class, and the types of publisher Ids are expressed by the UAPublisherIdType Enumeration. The easiest way to create a publisher Id is to use one of the static CreateXXXX methods, defined on the class:

In a Message Filtering (OPC UA PubSub), you can also use a publisher Id with type None. This specifies that no filtering on publisher Ids should be performed.

Writer Group Id

The writer group Id is an unsigned 16-bit integer that identifies the writer group. It is unique across writer groups for a publisher Id. Writer groups can only have non-zero Ids, but a zero writer group Id may be used in a Message Filtering (OPC UA PubSub) to specify that no filtering on writer group Ids should be performed.

Dataset Writer Id

The dataset writer Id identifies the dataset writer in the writer group. It is an unsigned 16-bit integer that is unique across all dataset writers for a publisher Id. Dataset writers can only have non-zero Ids, but a zero dataset writer Id may be used in a Message Filtering (OPC UA PubSub) to specify that no filtering on dataset writer Ids should be performed.

Field Name and Field Index

Each dataset consists of a collection of dataset fields. Each field has a unique name within a dataset. Some message mappings (such as JSON) transfer the field names in the dataset message, others (such as UADP) do not, and they rely on the order of fields, which then must be the same as in the dataset metadata.

When OPC Studio components deliver information to you, it preferably uses field names, but it resorts to field indexes when the field names are not available. When you need to specify a dataset field to OPC Studio components, you can use either form (name or index). Normally, we recommend using field names and not field indexes, but an exception must be made in case when message mapping such as UADP is sued, and metadata (as a source of field names) is not available).

Dataset Metadata (OPC UA PubSub) can be provided through OPC UA PubSub logical resolution, or you can supply it manually (from the code).

Physical identifier with topic tree

When OPC UA PubSub Topic Tree is used, writer group name and dataset writer name become physical identifiers.

 

See Also

Examples - OPC UA PubSub

Reference

Knowledge Base